using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BaHuan.Common;
using BaHuan.Entities;
using BaHuan.DataLayer;
/*
 * There are many processes that handle the flows of data
 * we call them business logic of a program.
 * For each of business logic process we create a class 
 * that handle for that process
 * 
 * */
namespace BaHuan.BusinessLayer
{
	
	public class DonGiaNguyenVatLieuManagement
	{
	
		public ResultObj SaveNewDonGiaNguyenVatLieu(DonGiaNguyenVatLieu dongianguyenvatlieu)
        		{
			ResultObj result = new ResultObj();
			dongianguyenvatlieu.Id = -1;
			DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
			result = dongianguyenvatlieuDAO.SaveDonGiaNguyenVatLieu(dongianguyenvatlieu);
			
			return result;
		}
		
		public ResultObj UpdateDonGiaNguyenVatLieu(DonGiaNguyenVatLieu dongianguyenvatlieu)
        		{
			ResultObj result = new ResultObj();
			DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
			result = dongianguyenvatlieuDAO.SaveDonGiaNguyenVatLieu(dongianguyenvatlieu);
			
			return result;
		}
		
		public ResultObj DeleteDonGiaNguyenVatLieu(DonGiaNguyenVatLieu dongianguyenvatlieu)
        		{
			ResultObj result = new ResultObj();
			DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
			result = dongianguyenvatlieuDAO.DeleteDonGiaNguyenVatLieu(dongianguyenvatlieu);
			
			return result;
		}
		
		public ResultObj GetAllDonGiaNguyenVatLieu( )
        		{
			ResultObj result = new ResultObj();
			DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
			result = dongianguyenvatlieuDAO.GetAllDonGiaNguyenVatLieu();
			
			return result;
		}
		
		public ResultObj GetDonGiaNguyenVatLieuById(DonGiaNguyenVatLieu dongianguyenvatlieu)
        		{
			ResultObj result = new ResultObj();
			DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
			result = dongianguyenvatlieuDAO.GetAllDonGiaNguyenVatLieuByID(dongianguyenvatlieu);
			
			return result;
		}

        public ResultObj GetDonGiaNguyenVatLieu(DonGiaNguyenVatLieu dongianguyenvatlieu)
        {
            ResultObj result = new ResultObj();
            DonGiaNguyenVatLieuDAO dongianguyenvatlieuDAO = new DonGiaNguyenVatLieuDAO();
            result = dongianguyenvatlieuDAO.GetDonGiaNguyenVatLieu(dongianguyenvatlieu);

            return result;
        }
	}
}
